<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var count = 0;
        var guess =Math.floor( Math.random()*100%99+1);
        console.log(guess);
         var val = 0;
        while(count<7)
        { 
            val = prompt("请输入你猜测的数字");
            if(val === guess)
            {
               alert("恭喜你猜对了,结束游戏");
               break;
            }
            else if(val<guess)
            {
                alert("猜小了");
            }else if(val>guess)
            {
                alert("猜大了");
            }
            count++;
        }

        if(val!==guess)
        {
         
            alert(`要猜测的数字是${guess},您的次数用完了，您失败了`)
        }
    </script>
</body>
</html>